home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 4 / develop 4 code / Poly. in Code Resources / Virtual WDEF / ProcessVTables < prev    next >
Encoding:
Text File  |  1990-07-24  |  798 b   |  43 lines  |  [TEXT/MPS ]

  1. #
  2. #    ProcessVTables
  3. #    Script to process a C++ virtual table built by CFront.
  4. #
  5. #    by Patrick C. Beard
  6. #
  7. #    Copyright © 1990, by Patrick C. Beard.  All rights reserved.
  8. #
  9.  
  10. Set Echo 0
  11.  
  12. # scan the argument list.
  13.  
  14. Unset vtables options
  15.  
  16. Loop
  17.     Break if {#} == 0
  18.     If "{1}" !~ /-≈/
  19.         Set vtables "{1}"
  20.         shift 1
  21.         continue
  22.     Else If "{1}" =~ /-≈/
  23.         Set options "{1}"
  24.         shift 1
  25.         continue
  26.     End
  27. End
  28.  
  29. # generate the C code for the virtual tables.
  30.  
  31. CPlus -mf -c -vtbl1 "{vtables}" > __vtable__.c
  32.  
  33. # run the resulting code through filters that do what we want.
  34.  
  35. filtertables "{options}" < __vtable__.c > __newvtable__.c
  36. fixtables "{options}"  < __vtable__.c >> __newvtable__.c
  37.  
  38. # compile the results and delete temporary files.
  39.  
  40. C -b -w3 __newvtable__.c -o "{vtables}.o"
  41. delete __vtable__.c
  42. delete __newvtable__.c
  43.